package com.lhy.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lhy.entity.User;
import com.lhy.mapper.UserMapper;
import com.lhy.service.UserService;
import com.lhy.utils.OssUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    public PageInfo<User> selectAll(Integer current, Integer pageSize) {
        PageHelper.startPage(current,pageSize);
        List<User> list = userMapper.selectAll();
        PageInfo<User> pageInfo=new PageInfo<User>(list);



        return pageInfo;
    }

    public User selectById(Integer id) {

        User user = userMapper.selectById(id);

        return user;
    }

    public List<User> selectByLike(String like) {
        List<User> userList = userMapper.selectByLike(like);

        return userList;

    }

    public int insertUser(User user) {

        int i = userMapper.insertUser(user);

        return i;
    }

    public int deleteUser(Integer id) {
        int i = userMapper.deleteUser(id);

        return i;
    }

    public void updateUser(User user) {


    }


}
